import { Connection } from 'mongoose';
import { getInstance } from '../../db';
import { accountSchema } from '../../schemas/accountSchema';

export async function queryInfo():Promise<IAnyObject> {
  const db: Connection = await getInstance();

  const accountmodel = db.model('accountmodel', accountSchema);

  const dataList = await accountmodel.find().exec();

  return {
    data: dataList,
    page_size: 1,
    page_num: 1,
  }
}
